<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:fmt="http://java.sun.com/jsp/jstl/functions">
	<f:loadBundle var="bundle" basename="resources.application" />
	<h:head>
		<title>JSF2 AJAX Demo Page</title>
		<!-- <h:outputScript name="jquery.js" library="js" target="head" /> -->
	</h:head>
	<h:body>
		<h:form id="ajaxForm">
				<h:outputLabel for="user" value="Enter Name : " />
				<h:inputText id="user" value="#{ajaxBean.user}">
					<f:ajax event="change" render="ajaxPanel" listener="#{ajaxBean.handleAjaxEvent}" />
				</h:inputText> <br />
				<h:outputLabel for="sel" value="Select a Number : " />
				<h:selectOneMenu id="sel" value="#{ajaxBean.selection}">
					<f:selectItem itemLabel="1" itemValue="1" />
					<f:selectItem itemLabel="2" itemValue="2" />
					<f:selectItem itemLabel="3" itemValue="3" />
					<f:ajax render="ajaxPanel" listener="#{ajaxBean.handleAjaxEvent}" />
				</h:selectOneMenu> <br />
				<h:outputLabel for="ajaxPanel" value="your ajax result" /> <br/>
				<hr style="width: 350px;" align="left" />
				<h:outputText id="ajaxPanel" value="#{ajaxBean.result}" />
		</h:form>
	</h:body>
</html>